package thread;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class SleepDemo {
    public static void main(String[] args) throws IOException {
        System.out.println("程序开始了");
        //Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个数");
        BufferedReader br=new BufferedReader(
                new InputStreamReader(
                        System.in
                )
        );
        String line=br.readLine();
        int num=Integer.parseInt(line);
        try {
            for (; num >0 ; num--) {
                System.out.println(num);
                Thread.sleep(1000);
            }

        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("时间到!");
        System.out.println("程序结束");
    }
}
